import request from '@/utils/request'

export function getAll() {
  return request({
    url: '/wish/all',
    method: 'get'
  })
}

export function getById(id) {
  return request({
    url: '/wish/one/wishFillId',
    method: 'get',
    params: {
      wishFillId: id
    }
  })
}

export function updateById(wishfill) {
  return request({
    url: '/wish/',
    method: 'put',
    params: {
      wishFillId: wishfill.wishFillId,
      wishFirst: wishfill.wishFirst,
      wishSecond: wishfill.wishSecond,
      wishThird: wishfill.wishThird,
      wishFourth: wishfill.wishFourth,
      wishFifth: wishfill.wishFifth
    }
  })
}

export function deexport() {
  return request({
    url: '/wish/Excel',
    method: 'get'
  })
}

export function divide() {
  return request({
    url: '/wish/result',
    method: 'post'
  })
}

export function search(search) {
  return request({
    url: '/wish/search',
    method: 'get',
    params: {
      userId: search.userId,
      userName: search.userName
    }
  })
}
